package mjc.egg;
import mjc.compiler.*;
import mjc.gc.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.messages.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
public class S_DEF_MJAVA {
LEX_MJAVA scanner;
  S_DEF_MJAVA() {
    }
  S_DEF_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_hnomclasse;
  TDS att_htdsclasses;
  String att_hvisibilite;
  INFOCLASSE att_hinfoclasse;
  INFOCLASSE att_infoclasse;
  LEX_MJAVA att_scanner;
  private void regle11() throws Exception {

    //declaration
    S_TYPE_MJAVA x_2 = new S_TYPE_MJAVA(scanner) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    T_MJAVA x_4 = new T_MJAVA(scanner ) ;
    //appel
      action_auto_inh_11(x_2, x_3);
    x_2.analyser() ;
    x_3.analyser(LEX_MJAVA.token_ident);
    x_4.analyser(LEX_MJAVA.token_pv);
      action_remontee_11(x_2, x_3);
  }
  private void regle12() throws Exception {

    //declaration
    S_TYPE_MJAVA x_2 = new S_TYPE_MJAVA(scanner) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    T_MJAVA x_4 = new T_MJAVA(scanner ) ;
    S_PARFS_MJAVA x_6 = new S_PARFS_MJAVA(scanner) ;
    T_MJAVA x_7 = new T_MJAVA(scanner ) ;
    S_BLOC_MJAVA x_9 = new S_BLOC_MJAVA(scanner) ;
    //appel
      action_auto_inh_12(x_2, x_3, x_6, x_9);
    x_2.analyser() ;
    x_3.analyser(LEX_MJAVA.token_ident);
    x_4.analyser(LEX_MJAVA.token_paro);
      action_avant_12(x_2, x_3, x_6, x_9);
    x_6.analyser() ;
    x_7.analyser(LEX_MJAVA.token_parf);
      action_action_12(x_2, x_3, x_6, x_9);
    x_9.analyser() ;
      action_remontee_12(x_2, x_3, x_6, x_9);
  }
  private void regle13() throws Exception {

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    T_MJAVA x_3 = new T_MJAVA(scanner ) ;
    S_PARFS_MJAVA x_5 = new S_PARFS_MJAVA(scanner) ;
    T_MJAVA x_6 = new T_MJAVA(scanner ) ;
    S_BLOC_MJAVA x_8 = new S_BLOC_MJAVA(scanner) ;
    //appel
      action_auto_inh_13(x_2, x_5, x_8);
    x_2.analyser(LEX_MJAVA.token_ident);
    x_3.analyser(LEX_MJAVA.token_paro);
      action_avant_13(x_2, x_5, x_8);
    x_5.analyser() ;
    x_6.analyser(LEX_MJAVA.token_parf);
      action_action_13(x_2, x_5, x_8);
    x_8.analyser() ;
      action_remontee_13(x_2, x_5, x_8);
  }
private void action_action_12(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// locales
TDS loc_t;
SIGNATURE loc_s;
INFOMETHODE loc_i;
// instructions
loc_i= new INFOMETHODE(x_3.att_txt, x_6.att_parametres, x_2.att_type, this.att_hvisibilite);
loc_s= new SIGNATURE(x_3.att_txt);
    loc_s.getTypesFromParams(x_6.att_parametres);
    loc_i.setSignature(loc_s);
loc_t= new TDS(this.att_hinfoclasse.getAttributs());
    loc_t.addVarsFromParams(x_6.att_parametres);
    loc_t.inserer(loc_s.toString(), loc_i);
x_9.att_htdsvarlocales=loc_t;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_action_13(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// locales
TDS loc_t;
// instructions
loc_t= new TDS(this.att_hinfoclasse.getAttributs());
    loc_t.addVarsFromParams(x_5.att_parametres);
x_8.att_htdsvarlocales=loc_t;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_avant_13(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// instructions
x_5.att_hparametres= new PARAMETRES();
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_avant_12(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// instructions
x_6.att_hparametres= new PARAMETRES();
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_remontee_13(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// locales
TDS loc_t;
SIGNATURE loc_s;
INFOCONSTRUCTEUR loc_i;
// instructions
loc_i= new INFOCONSTRUCTEUR(x_2.att_txt, x_5.att_parametres, this.att_hvisibilite);
loc_s= new SIGNATURE(x_2.att_txt);
    loc_s.getTypesFromParams(x_5.att_parametres);
    loc_i.setSignature(loc_s);
    loc_i.setVarsLocales(x_8.att_tdsvarlocales);
loc_t=this.att_hinfoclasse.getAttributs();
    loc_t.inserer(loc_s.toString(), loc_i);
this.att_infoclasse=this.att_hinfoclasse;
System.out.print(""+"> "+loc_i.toString()+"\n");
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_remontee_12(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// locales
TDS loc_ti;
TDS loc_t;
SIGNATURE loc_s;
INFO loc_i;
// instructions
loc_s= new SIGNATURE(x_3.att_txt);
loc_ti=this.att_hinfoclasse.getAttributs();
    loc_s.getTypesFromParams(x_6.att_parametres);
loc_i=x_9.att_tdsvarlocales.chercherGlobalement(loc_s.toString());
if (loc_i instanceof INFOMETHODE ){
    ((INFOMETHODE)loc_i).setVarsLocales(x_9.att_tdsvarlocales);
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unknown_token, MJAVAMessages.MJAVA_unknown_token,new Object[]{""+x_3.att_txt});


}
    loc_ti.inserer(loc_s.toString(), loc_i);
this.att_infoclasse=this.att_hinfoclasse;
System.out.print(""+"> "+loc_i.toString()+"\n");
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_remontee_11(S_TYPE_MJAVA x_2, T_MJAVA x_3) throws Exception {
try {
// locales
INFOATTRIBUT loc_i;
TDS loc_t;
// instructions
loc_i= new INFOATTRIBUT(x_3.att_txt, x_2.att_type, this.att_hvisibilite);
loc_t=this.att_hinfoclasse.getAttributs();
    loc_t.inserer(x_3.att_txt, loc_i);
this.att_infoclasse=this.att_hinfoclasse;
System.out.print(""+"> ATTRIBUT "+loc_i.toString()+"\n");
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_auto_inh_11(S_TYPE_MJAVA x_2, T_MJAVA x_3) throws Exception {
try {
// instructions
x_2.att_htdsclasses=this.att_htdsclasses;
x_2.att_hinfoclasse=this.att_hinfoclasse;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_auto_inh_12(S_TYPE_MJAVA x_2, T_MJAVA x_3, S_PARFS_MJAVA x_6, S_BLOC_MJAVA x_9) throws Exception {
try {
// instructions
x_2.att_htdsclasses=this.att_htdsclasses;
x_6.att_htdsclasses=this.att_htdsclasses;
x_9.att_htdsclasses=this.att_htdsclasses;
x_2.att_hinfoclasse=this.att_hinfoclasse;
x_6.att_hinfoclasse=this.att_hinfoclasse;
x_9.att_hinfoclasse=this.att_hinfoclasse;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
private void action_auto_inh_13(T_MJAVA x_2, S_PARFS_MJAVA x_5, S_BLOC_MJAVA x_8) throws Exception {
try {
// instructions
x_5.att_htdsclasses=this.att_htdsclasses;
x_8.att_htdsclasses=this.att_htdsclasses;
x_5.att_hinfoclasse=this.att_hinfoclasse;
x_8.att_hinfoclasse=this.att_hinfoclasse;
}catch(RuntimeException e) {		//e.printStackTrace();
       scanner._interrompre(IProblem.Internal, scanner.getBeginLine(), ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,e.getStackTrace());
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_int : // 19927
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 19955
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 19920
                regle11 () ;
              break ;
              case LEX_MJAVA.token_paro : // 19913
                regle12 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_int);
        }
      break ;
      case LEX_MJAVA.token_bool : // 19928
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 19955
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 19920
                regle11 () ;
              break ;
              case LEX_MJAVA.token_paro : // 19913
                regle12 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_bool);
        }
      break ;
      case LEX_MJAVA.token_void : // 19926
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 19955
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 19920
                regle11 () ;
              break ;
              case LEX_MJAVA.token_paro : // 19913
                regle12 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_void);
        }
      break ;
      case LEX_MJAVA.token_ident : // 19955
        scanner.lit ( 2 ) ;
        switch ( scanner.fenetre[1].code ) {
          case LEX_MJAVA.token_ident : // 19955
            scanner.lit ( 3 ) ;
            switch ( scanner.fenetre[2].code ) {
              case LEX_MJAVA.token_pv : // 19920
                regle11 () ;
              break ;
              case LEX_MJAVA.token_paro : // 19913
                regle12 () ;
              break ;
              default :
                       scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[2].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
            }
          break ;
          case LEX_MJAVA.token_paro : // 19913
            regle13 () ;
          break ;
          default :
                   scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[1].getNom()});
scanner.accepter_sucre(LEX_MJAVA.token_ident);
        }
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
  }
